import javax.swing.*;
import java.awt.*;

public class Launcher
{
	public static void main(String args[]){new Launcher();}
	
	private StateController stateControl;
	private DisplayContainer displayContainer;
	
	public Launcher()
	{
		stateControl = new StateController();
		stateControl.addState(new TestGameState());
		displayContainer = new DisplayContainer();
		
		displayContainer.setDisplay(stateControl.getCurrentState().getDisplay());
		displayContainer.setKeyListener(stateControl.getCurrentState().getKeyListener());
		displayContainer.setMouseListener(stateControl.getCurrentState().getMouseListener());
		
		displayContainer.setFullscreen(true);
		
		
		long time = System.currentTimeMillis();
		
		while(true)
		{
			if(time + 15 < System.currentTimeMillis())
			{
				stateControl.getCurrentState().update();
				stateControl.getCurrentState().render();
				
				time = System.currentTimeMillis();
			}
		}
	}
}